package test.socket;

import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.InetSocketAddress;
import java.net.Socket;

public class Client {
	
	public static void main(String[] args) {
		Socket s = new Socket();
		try {
			s.connect(new InetSocketAddress("127.0.0.1", 6666));
			OutputStream os = s.getOutputStream();
			PrintWriter pw = new PrintWriter(os);
			pw.println("hello");
			pw.flush();
			pw.println("bye");
			pw.flush();
			s.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
